import {useState} from "react";
import axios from 'axios'
import { InfiniteScroll} from 'antd-mobile'

const App=()=>{
  let [list,setLise]=useState([])
const [pageCode,setPageCode]=useState(1)
const data= async ()=>{
  const request= await axios.get('/api/room/list',{params:{pageCode}});
  const  newList=request.data.data.list;
  setLise(list.concat(newList))
  setPageCode(pageCode+1)
console.log(`这是第${pageCode}页`)
}
  return (
    <div>
dffff
{
  list.map((v)=>{
    return (
      <dl key={v.id}>
        <dt>
        <img src={v.url} alt="" style={{width:'100px', height:'100px'}} />
        </dt>
        <dd>
<span>{v.title}</span>
        </dd>
      </dl>
    )
  })
}
<InfiniteScroll loadMore={data} hasMore={true} />
    </div>
  )
}
export default App